package com.zrulin.findcomrade.controller;

import com.zrulin.findcomrade.pojo.User;
import com.zrulin.findcomrade.service.UserService;
import com.zrulin.findcomrade.vo.Msg;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author zrulin
 * @create 2021-04-22 15:07
 */
@Api(description = "测试接口")
@RestController
public class TestController {

    @Autowired
    UserService userService;

    @ApiOperation("测试方法")
    @GetMapping("/test")
    public Msg test(){
        User user = userService.queryByUsername("tom");
        return new Msg(200,user,null);
    }
}
